package com.veetao.api.errcode;

import java.util.HashMap;
import java.util.Map;

import com.veetao.api.model.ApiResultCode;


public class ErrorCodeMessage {

	public static final String MESSAGE_CODE_DEFAULT = "10000";
	public static final String MESSAGE_CODE_INVALID_PARAMS = "10001";
	public static final String MESSAGE_CODE_INNER_ERROR = "10002";
	public static final String MESSAGE_CODE_INVALID_CODE = "10003";
	public static final String MESSAGE_CODE_NOT_ENOUGH_SCORE = "10005";
	public static final String MESSAGE_CODE_NOT_ENOUGH_USER_GRADE = "10006";
	public static final String MESSAGE_CODE_NOT_ENOUGH_GIFT = "10007";
	public static final String MESSAGE_CODE_NOT_IN_PERIOD = "10008";
	public static final String MESSAGE_CODE_INVITOR_EXIST = "10009";
	public static final String MESSAGE_CODE_DUPLICATE_BUY = "10010";
	public static final String MESSAGE_CODE_INVALID_ORDER_ID = "10011";
	public static final String MESSAGE_CODE_INVALID_MOBILE = "10012";
	public static final String MESSAGE_CODE_ACCT_EXISTS = "10013";
	public static final String MESSAGE_CODE_ACCT_NOT_EXISTS = "10014";
	public static final String MESSAGE_CODE_DATA_NOT_EXISTS = "10015";
	public static final String MESSAGE_CODE_ORDER_TO_PAY = "10016";
	public static final String MESSAGE_CODE_GROUPBUY_FINISHED = "10017";
	public static final String MESSAGE_CODE_ORDER_EXPIRED = "10018";
	public static final String MESSAGE_CODE_FAMILY_MANAGE_DENY = "10019";
	public static final String MESSAGE_CODE_INVALID_CHANNEL_TOKEN = "10020";

	private static Map<String,String> tipsMap;
	static {
		tipsMap = new HashMap<String, String>();
		
		tipsMap.put(MESSAGE_CODE_DEFAULT, "操作失败");
		tipsMap.put(MESSAGE_CODE_INVALID_PARAMS, "参数错误");
		tipsMap.put(MESSAGE_CODE_INNER_ERROR, "系统暂时不可用，请稍后重试");
		tipsMap.put(MESSAGE_CODE_INVALID_CODE, "验证码错误");
		tipsMap.put(MESSAGE_CODE_NOT_ENOUGH_SCORE, "嗨币不足，赶紧努力挣嗨币吧");
		tipsMap.put(MESSAGE_CODE_NOT_ENOUGH_USER_GRADE, "对不起，您的等级不符合要求");
		tipsMap.put(MESSAGE_CODE_NOT_ENOUGH_GIFT, "对不起，礼物已经被抢光");
		tipsMap.put(MESSAGE_CODE_NOT_IN_PERIOD, "对不起，活动未开始");
		tipsMap.put(MESSAGE_CODE_INVITOR_EXIST, "已被其他用户邀请");
		tipsMap.put(MESSAGE_CODE_DUPLICATE_BUY, "您已经兑换过这个礼品，请兑换其他礼品");
		tipsMap.put(MESSAGE_CODE_INVALID_ORDER_ID, "无效的订单");
		tipsMap.put(MESSAGE_CODE_INVALID_MOBILE, "无效手机号码");
		tipsMap.put(MESSAGE_CODE_ACCT_EXISTS, "账号已经存在");
		tipsMap.put(MESSAGE_CODE_ACCT_NOT_EXISTS, "账号不存在");
		tipsMap.put(MESSAGE_CODE_DATA_NOT_EXISTS, "数据不存在");
		tipsMap.put(MESSAGE_CODE_ORDER_TO_PAY, "您已经买过这个商品，请到我的订单中完成支付");
		tipsMap.put(MESSAGE_CODE_GROUPBUY_FINISHED, "团购已结束");
		tipsMap.put(MESSAGE_CODE_ORDER_EXPIRED, "付款超时，系统已取消订单");
		tipsMap.put(MESSAGE_CODE_FAMILY_MANAGE_DENY, "没有家庭管理权限");
		
		tipsMap.put(ApiResultCode.E_SYS_INVALID_APP_ID+"", "无效AppId");
		tipsMap.put(ApiResultCode.E_SYS_INVALID_SIG+"", "签名错误");
		tipsMap.put(ApiResultCode.E_SYS_INVALID_TICKET+"", "无效票信息,请重新登录");
		tipsMap.put(ApiResultCode.E_SYS_INVALID_VERSION+"", "无效版本号");
		tipsMap.put(ApiResultCode.E_SYS_PARAM + "", "参数不完整或无效");
		tipsMap.put(ApiResultCode.E_SYS_PERMISSION_DENY+"", "用户无权限");
		tipsMap.put(ApiResultCode.E_SYS_REQUEST_TOO_FAST+"", "操作太频繁");
		tipsMap.put(ApiResultCode.E_SYS_RPC_ERROR+"", "系统错误，请稍后重试");
		tipsMap.put(ApiResultCode.E_SYS_UNKNOWN+"", "未知错误");
		tipsMap.put(ApiResultCode.E_SYS_UNKNOWN_METHOD+"", "请求接口错误");
		tipsMap.put(ApiResultCode.E_SYS_OTHER_DID_SIGN+"", "您的账号已在其他设备登陆");
		tipsMap.put(ApiResultCode.E_SYS_TIME_OUT_SIGN+"", "您的账号登陆信息已超时，请重新登陆");
		tipsMap.put(MESSAGE_CODE_INVALID_CHANNEL_TOKEN+"", "渠道令牌错误或已失效");
		
		
	}
	public static String getMessage(String code) {
		String tip = tipsMap.get(code);
		return tip == null ? "" : tip;
	}

}
